﻿using UnityEngine;
using System.Collections;

public class CFS_GameLogic : MonoBehaviour
{
	float startTime;
	float gameDuration = 0.0f;

	// Use this for initialization
	void Start () 
	{
		startTime = Time.time;
		Screen.lockCursor = true;
	}
	
	float GetTime()
	{
    	return Time.time - startTime;
	}
	
	void Update()
	{
		//Store the ammount of elapsed time\\
		gameDuration += Timing.CustomDeltaTime();
	}
	
	void OnGUI()
	{
		GUILayout.BeginVertical();
		
		if (GUI.Button(new Rect(10, 10, 60, 30), "Restart"))
            Application.LoadLevel(Application.loadedLevel);
		
		
		
		GUI.Label(new Rect(10, 40, 100, 100),"Game Duration " + GetTime().ToString("00:00"));
		
		GUILayout.EndVertical();
	}
}
